<%--
  Created by IntelliJ IDEA.
  User: W len P
  Date: 2022/2/4
  Time: 12:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script src="js/jQuery.js"></script>
    <title>Title</title>
</head>
<body>

<%--<a href="/account/findAll">查询全部</a>--%>

<%--<form action="/account/save" method="post">--%>
<%--    用户id：<input type="text" name="uid">--%>
<%--    金额：<input type="text" name="money">--%>
<%--    <input type="submit" value="提交">--%>
<%--</form>--%>

<%--<a href="/user/queryAllUser">查询所有用户</a>--%>

<form action="/user/login" method="get" id="loginForm">
    <label for="username">Username：</label>
    <input type="text" name="username" id="username"><br>
    <label for="password">Password：</label>
    <input type="text" name="password" id="password"><br>
    <button type="submit" id="login">登录</button>
</form>

<button id="test">点击测试一对一</button>

</body>
<script>
    $(function (){
        $('#submit').click(function () {
            $.ajax({
                url:'/user/register',
                type:'get',
                dataType:'json',
                data:$('#registerForm').serialize(),
                success:function(data){
                    alert(data)
                }
            })
        })

        $('#test').click(function(){
            $.ajax({
                url:'/onetoone/selectAll',
                type: 'get',
                dataType: 'json',
                success:function (data){
                    console.log(data)
                }
            })
        })

        // $('#updateSubmit').click(function (){
        //     $.ajax({
        //         url:'/user/updateUser',
        //         type: 'get',
        //         dataType: 'json',
        //         data:$('#updateFrom').serialize(),
        //         success:function (data){
        //             alert(data)
        //         }
        //     })
        // })
    })

</script>
</html>
